package com.ddpt.permission;

import org.apache.commons.lang3.StringUtils;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

import java.util.Arrays;

@EnableDubbo
@MapperScan("com.ddpt.**.mapper")
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = "com.ddpt")
public class PermissionApplication {

    public static void main(String[] args) {
        if(StringUtils.isBlank(System.getProperty("project.name"))){
            System.setProperty("project.name","Permission");
        }
        args = Arrays.copyOf(args, args.length + 1);
        args[args.length - 1] = "--spring.cloud.bootstrap.enabled=true";
        SpringApplication.run(PermissionApplication.class, args);
        System.out.println("【permission】服务启动完成");
    }

}
